<template>
  <div style="background:#f0efef;">
    <!-- navbar -->
    <!-- <van-nav-bar title="消息" @click-left="onClickLeft" class="notice" fixed>
      <template #left>
        <van-icon name="arrow-left" size="18" />
      </template>
      <template #right>
        <van-icon name="ellipsis" size="18" />
      </template>
    </van-nav-bar> -->
    <!--notice  -->
    <!-- <div class="notice_container">
      <div class="notice_box" v-for="(item, index) in message" :key="index">
        <div class="notice_time">{{ item.now }}</div>
        <p>
          您的借书《{{ item.bookName }}》还有{{
            item.day
          }}天到期，请注意完成退书操作
        </p>
      </div>
    </div> -->
    <div class="notice_container">
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的书籍《梅尔罗斯》还有5天用户借书到期，请注意用户是否退还操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-20</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的书籍《梅尔罗斯》还有5天用户借书到期，请注意用户是否退还操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-20</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-18</div>
        <p>您的书籍《梅尔罗斯》还有5天用户借书到期，请注意用户是否退还操作</p>
      </div>
      <div class="notice_box">
        <div class="notice_time">2021-9-20</div>
        <p>您的借书《云边有个小卖部》还有1天到期，请注意完成退书操作</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      message: "",
      name: "",
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push("/cumster");
    },
    //mgop
    getNotice(name) {
      const params = new URLSearchParams();
      params.append("name", this.name);
      const noticeMsg = async () => {
        const res = await this.mgopfn("mgop.educational.system.sendMsg", {
          name: this.name,
        });
        console.log(res);
        this.message = res.data.msg;
      };
      noticeMsg();
    },
  },
  mounted() {
    // console.log(this.$route.query.username);
    this.name = window.localStorage.getItem("usernameData");
    console.log("本地数据：" + this.name);
    // this.getMessage();
    this.getNotice();
  },
};
</script>

<style>
@media screen and (min-width: 320px) {
  .notice_container {
    width: 100%;
    height: 100%;
    /* background: pink; */
    background: #f0efef;
    padding-bottom: 50px;
  }
  .notice_box {
    width: 80%;
    height: 10%;
    background: #fff;
    margin: 0 auto;
    position: relative;
    top: 40px;
    margin-bottom: 20px;
    border-radius: 10px;
    padding-bottom: 20px;
  }
  .notice_time {
    background: #5a78ec;
    color: #fff;
    width: 45%;
    height: 24%;
    font-size: 14px;
    text-align: center;
    border-radius: 5px 0px 0px 0px;
    display: block;
  }
  .notice_container p {
    font-size: 12px;
    width: 95%;
    margin: 0 auto;
    padding-top: 10px;
  }
}
@media screen and (min-width: 375px) {
  .notice_container {
    width: 100%;
    height: 100%;
    /* background: pink; */
    background: #f0efef;
    padding-bottom: 90px;
  }
  .notice_box {
    width: 80%;
    height: 10%;
    background: #fff;
    margin: 0 auto;
    position: relative;
    top: 40px;
    margin-bottom: 20px;
    border-radius: 10px;
  }
  .notice_time {
    background: #5a78ec;
    color: #fff;
    width: 30%;
    height: 20%;
    font-size: 14px;
    text-align: center;
    border-radius: 5px 0px 0px 0px;
    display: block;
  }
  .notice_container p {
    font-size: 12px;
    width: 95%;
    margin: 0 auto;
    padding-top: 10px;
  }
}
@media screen and (min-width: 414px) {
  .notice_container {
    width: 100%;
    height: 100%;
    /* background: pink; */
    background: #f0efef;
  }
  .notice_box {
    width: 80%;
    height: 12%;
    background: #fff;
    margin: 0 auto;
    position: relative;
    top: 40px;
    margin-bottom: 20px;
    border-radius: 10px;
  }
  .notice_time {
    background: #5a78ec;
    color: #fff;
    width: 30%;
    height: 20%;
    font-size: 16px;
    text-align: center;
    border-radius: 5px 0px 0px 0px;
    display: block;
  }
  .notice_container p {
    font-size: 14px;
    width: 95%;
    margin: 0 auto;
    padding-top: 10px;
  }
}
@media screen and (min-width: 768px) {
  /deep/.van-nav-bar {
    width: 100%;
    line-height: 22px;
    font-size: 22px;
  }
  /deep/.van-nav-bar__content {
    height: 60px !important;
  }
  /deep/.van-nav-bar__title {
    font-size: 24px !important;
  }
  .notice_container {
    width: 100%;
    height: 100%;
    /* background: pink; */
    background: #f0efef;
  }
  .notice_box {
    width: 80%;
    height: 12%;
    background: #fff;
    margin: 0 auto;
    position: relative;
    top: 60px;
    margin-bottom: 30px;
    border-radius: 10px;
  }
  .notice_time {
    background: #5a78ec;
    color: #fff;
    width: 30%;
    height: 20%;
    font-size: 20px;
    text-align: center;
    padding-top: 8px;
    border-radius: 5px 0px 0px 0px;
    display: block;
  }
  .notice_container p {
    font-size: 20px;
    width: 95%;
    margin: 0 auto;
    padding-top: 10px;
  }
}
@media screen and (min-width: 1024px) {
  /deep/.van-nav-bar {
    width: 100%;
    line-height: 22px;
    font-size: 26px;
  }
  /deep/.van-nav-bar__content {
    height: 80px !important;
  }
  /deep/.van-nav-bar__title {
    font-size: 26px !important;
  }
  .notice_container {
    width: 100%;
    height: 2000px;
    /* background: pink; */
    background: #f0efef;
    padding-bottom: 100px;
    padding-top: 20px;
  }
  .notice_box {
    width: 80%;
    height: 10%;
    background: #fff;
    margin: 0 auto;
    position: relative;
    top: 60px;
    margin-bottom: 30px;
    border-radius: 10px;
    margin-top: 20px;
  }
  .notice_time {
    background: #5a78ec;
    color: #fff;
    width: 30%;
    height: 20%;
    font-size: 28px;
    padding-top: 8px;
    text-align: center;
    border-radius: 5px 0px 0px 0px;
    display: block;
  }
  .notice_container p {
    font-size: 22px;
    width: 95%;
    margin: 0 auto;
    padding-top: 10px;
    font-size: 30px;
  }
}
</style>
